package com.sztz.mapstruct.O条件转换;

import cn.hutool.core.util.StrUtil;
import org.mapstruct.Condition;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * CarMapper
 *
 * @author yyf
 * @email yeyafei@hotmail.com
 */
@Mapper
public interface CarMapper {

    CarMapper INSTANCE = Mappers.getMapper(CarMapper.class);

    /**
     * 条件转换
     *
     * @param car
     * @return CarDto
     */
    CarDTO toDto(Car car);

    @Condition
    default boolean isNotBlank(String value) {
        return StrUtil.isNotBlank(value);
    }
}
